'use strict'

var arr = [21,8,35,9,7,18]

arr.soft1 = function (fn) {
    for (var i = 0; i < array.length; i++) {
        var aaa = array[i];
        var bbb = 0
        for (let j = i + 1; j < array.length; j++) {
            if (fn(aaa,array[j])) {
                aaa = array[j]
                bbb = j
            }
        }
        if (array[i] !== aaa) {
            var ccc = array[i]
            array[i] = array[bbb]
            array[bbb] = ccc
        }
        console.log(arr);
    }
}
arr.sort1(function (a, b) {
    return a > b 
})

var arr1 = [1,2,3.4,5,6]

arr1.splice(2,1,{age:38})

console.log(arr1);



